/*
 * Strategy.cpp
 *
 *  Created on: Apr 22, 2010
 *      Author: Soheil Damangir
 */

#include "Strategy.h"
#include "Control.h"
#include "../Util/Constants.h"
namespace Group5 {

void RightFirstStrategy::onDecide(const Occasion&_occ, const Robot&_robot)
{
  if (_occ.jRight)
  {
    _robot.turn_right();
    _robot.move_mm(Constants::get()->BLOCK_SIZE);
    return;
  }
  if (_occ.bFront || _occ.bomb)
  {
    if(_occ.jLeft)
    {
      _robot.turn_left();
      _robot.move_mm(Constants::get()->BLOCK_SIZE);
      return;
    }else{
      _robot.u_turn();
      _robot.move_mm(Constants::get()->BLOCK_SIZE);
    }
  }
}

}
